package com.example.datacollection.config;

import java.util.HashMap;
import java.util.Map;

public class ResultMap {
    public static Map<String, Object> ok() {
        Map<String, Object> map = new HashMap<>();
        map.put("code", "1");
        return map;
    }

    public static Map<String, Object> ok(String name, Object ob) {
        Map<String, Object> map = new HashMap<>();
        map.put("code","1");
        map.put(name, ob);
        return map;
    }

    public static Map<String, Object> error() {
        Map<String, Object> map = new HashMap<>();
        map.put("code", "0");
        return map;
    }

    public static Map<String, Object> error(String name, Object ob) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", "0");
        map.put(name, ob);
        return map;
    }
}
